<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>el的两种写法</title>
    <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript">
      Vue.config.productionTip = false;
    </script>
  </head>
  <body>
    <div id="root">
      <h1>Hello, {{name}}</h1>
    </div>
  </body>

  <script type="text/javascript">

    const v = new Vue({
      //第一种写法，创建时就指定为哪个容器服务
      //el: "#root",
      data: {
        name: "尚硅谷123",
      },
    });
    console.log(v);
    
    //第二种写法，后续指定容器和VUE绑定   使用定时器模拟延时
    setTimeout(() => {
      v.$mount("#root");
    }, 1000);

  </script>
</html>
